<script>on mouseUpvisual effect iris closego to first cardend mouseUp</script>
</part>
<content>
<layer>card</layer>
<id>1</id>
<text>This is an irc stack. Experiment. Maybe you want to improve it with me? Irc is Internet Relay Chat. The Idea is to Chat on The Chat Card by typing lines to the message box.Seppo Kallio kallio@jyu.fi--------This stack gives a simple example and testbed for HyperCard TCP applications. It lets you establish a connection to a specified host. Then it displays everything received over the connection, and lets you send lines via the Send Line button. You can also check the current connection state. When you're done, you can Release the connection (just to be safe, since it's imperative that a release is done, the closeCard method also does a release). --Harry Chesley</text>
</content>
<name>info</name>
<script></script>
</card>
card_5892.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<script>on mouseupset locktext of target to falseclick at mouseloc()click at mouseloc()get selectionput itset locktext of target to truego card "chat"if chartonum(first char of it) ≥ chartonum("0") and ¬chartonum(first char of it) ≤ chartonum("9") thensendhost "join " & itelsesendhost "join +" & itend ifsend mouseup to card button "refresh"end mouseup</script>
</part>
<part>
<id>2</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>0</left>
<top>298</top>
<right>74</right>
<bottom>313</bottom>
</rect>
<style>rectangle</style>
<showName> <true /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <true /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Geneva</font>
<textSize>10</textSize>
<textStyle>plain</textStyle>
<name>Clear Display</name>
<script>on mouseUpput empty into card field "screen"end mouseUp</script>
<script>on mouseUpglobal connectionIDsendhost "quit"wait 2 secondif connectionID is not empty thenTCPRelease connectionIDput empty into connectionIDend ifgo card 1end mouseUp</script>
</part>
<part>
<id>7</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>478</left>
<top>294</top>
<right>512</right>
<bottom>319</bottom>
</rect>
<style>roundrect</style>
<showName> <false /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <true /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>6720</icon>
<textAlign>center</textAlign>
<font>Chicago</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name>New Button</name>
<script>on mouseUpgo backend mouseUp</script>
</part>
<part>
<id>8</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <false /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>244</left>
<top>295</top>
<right>400</right>
<bottom>321</bottom>
</rect>
<style>rectangle</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Geneva</font>
<textSize>9</textSize>
<textStyle>bold</textStyle>
<textHeight>12</textHeight>
<name>Channel</name>
<script>on mouseUpglobal channelsendhost "who " & channelgo card "cusers"put empty into card field "Screen"end mouseUp</script>
</part>
<part>
<id>10</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>140</left>
<top>297</top>
<right>239</right>
<bottom>315</bottom>
</rect>
<style>roundrect</style>
<showName> <true /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <true /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Chicago</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name>Quit Channel</name>
<script>on mouseUpglobal Channelput "+HyperCard" into Channelsendhost "join +HyperCard"put "Users on this channel" && Channel into card field "Channel"end mouseUp</script>
</part>
<content>
<layer>background</layer>
<id>37</id>
<text>established</text>
</content>
<content>
<layer>card</layer>
<id>8</id>
<text>Users on this channel 43.</text>
</content>
<content>
<layer>card</layer>
<id>3</id>
<text>hello</text>
</content>
<content>
<layer>background</layer>
<id>47</id>
<text>16:51</text>
</content>
<content>
<layer>card</layer>
<id>1</id>
<text>hello</text>
</content>
<name>Chat</name>
<script>on returnkeyget messageput it into card field "LastInput"if it is "clr" thenput empty into card field "screen"put emptyexit returnkeyend ifput it & return after card field "Screen"put ctoc("äåöÄÅÖ","{}|[]\",it) into itsendhost "msg " & itput empty-- put empty into card field "screen"end returnkeyon opencardglobal channelshow messageput "Users on this channel " && channel & "." into card field "Channel"end opencard</script>
</card>
card_6523.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<script>on mouseupglobal channelset locktext of target to falseclick at mouseloc()click at mouseloc()get selectionset locktext of target to trueif chartonum(first char of it) ≥ chartonum("0") and ¬chartonum(first char of it) ≤ chartonum("9") thenput it into channelelseput "+" & it into channelend if-- send mouseup to card button "refresh"end mouseup</script>
</part>
<part>
<id>2</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>484</left>
<top>315</top>
<right>510</right>
<bottom>342</bottom>
</rect>
<style>roundrect</style>
<showName> <false /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <true /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>6720</icon>
<textAlign>center</textAlign>
<font>Chicago</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name>New Button</name>
<script>on mouseUpgo backend mouseUp</script>
</part>
<part>
<id>3</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>352</left>
<top>316</top>
<right>481</right>
<bottom>341</bottom>
</rect>
<style>roundrect</style>
<showName> <true /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <true /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Chicago</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name>Join this Channel</name>
<script>on mouseUpsendhost "join " & card field "channel" of card "Who"go card "Chat"put empty into card field "Screen"end mouseUp</script>
</part>
<content>
<layer>background</layer>
<id>37</id>
<text>closed</text>
</content>
<content>
<layer>background</layer>
<id>47</id>
<text>16:51</text>
</content>
<content>
<layer>card</layer>
<id>1</id>
<text>WHOREPLY * User Host Server Nickname S :NameWHOREPLY +HyperCard kallio kallio.jyu.fi jyu.fi Seppo H@ :Seppo Kallio:jyu.fi 315 Seppo :* End of /WHO list.</text>
</content>
<name>cusers</name>
<script></script>
</card>
card_5461.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<script>on mouseupglobal channelset locktext of target to falseclick at mouseloc()click at mouseloc()get selectionset locktext of target to trueif chartonum(first char of it) ≥ chartonum("0") and ¬chartonum(first char of it) ≤ chartonum("9") thenput it into card field "channel"elseput "+" & it into card field "channel"end ifput card field "Channel" into channelput "Who are at channel " & it into card field "WhoAre"-- send mouseup to card button "refresh"end mouseup</script>
</part>
<part>
<id>2</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>485</left>
<top>315</top>
<right>511</right>
<bottom>342</bottom>
</rect>
<style>roundrect</style>
<showName> <false /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <true /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>6720</icon>
<textAlign>center</textAlign>
<font>Chicago</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name>New Button</name>
<script>on mouseUpgo backend mouseUp</script>
</part>
<part>
<id>3</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>371</left>
<top>293</top>
<right>505</right>
<bottom>316</bottom>
</rect>
<style>roundrect</style>
<showName> <true /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <true /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Chicago</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name>Refresh User List</name>
<script>on mouseUpgo card "who"answer "Full Names or Short Names." with "Full" or "Short"if it is empty then exit mouseupput empty into card field "screen"if it is "Full" thensendhost "who"elsesendhost "names"end ifput "User list at" && the time && the date into card field "time"end mouseUp</script>
</part>
<part>
<id>4</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <false /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>94</left>
<top>2</top>
<right>309</right>
<bottom>21</bottom>
</rect>
<style>rectangle</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Geneva</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<textHeight>16</textHeight>
<name>time</name>
<script></script>
</part>
<part>
<id>7</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>372</left>
<top>315</top>
<right>483</right>
<bottom>341</bottom>
</rect>
<style>roundrect</style>
<showName> <true /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <true /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Chicago</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name>Channel Names</name>
<script>on mouseUpif visible of card field "Screen2" is true thenhide card field "Screen2"exit mouseupend ifget line 1 of card field "Screen"if it contains "NAMREPLY" thenput true into NAMREPLYelseput false into NAMREPLYend ifput number of lines of card field "Screen" into cput "Channel names:" & return into card field "Screen2"show card field "screen2"repeat with i = 1 to cget line i of card field "screen"set cursor to busyif NAMREPLY thenget word 3 of itelseget word 2 of itend if-- if mouse() is down then exit mouseupif it is not "*" and it is not in card field "Screen2" thenput it & return after card field "Screen2"end ifend repeatend mouseUp</script>
</part>
<part>
<id>8</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <true /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <true /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>348</left>
<top>29</top>
<right>483</right>
<bottom>243</bottom>
</rect>
<style>scrolling</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <true /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Geneva</font>
<textSize>10</textSize>
<textStyle>plain</textStyle>
<textHeight>13</textHeight>
<name>screen2</name>
<script>on mouseupglobal channelget clickline()get value(it)put it into card field "Channel"put it into channelput "Who are at channel " & it into card field "WhoAre"end mouseup</script>
<script>on mouseUpput card field "channel" into itif card field "channel" is not empty thengo card "Cusers"put empty into card field "Screen"sendhost "who " & itelseanswer "Select channel first"end ifend mouseUp</script>
<script>on idleglobal connectionIDput the time into bg field "TheTime"if connectionID is empty thenput "State=no connection" into field "state"exit idleend ifget TCPState(connectionID)put "State=" & it into field "state"if it is "please close" thenglobal connectionIDif connectionID is not empty thenTCPRelease connectionIDput empty into connectionIDend ifend ifif it is not "established" then exit idle-- connectionID,return,10,emptyput TCPRecvUpTo(connectionID,empty,10,empty) into newInputif newInput is not empty then-- put newinputset cursor to busyif first word of newinput is "PING" thensendhost "PONG"put "PONG" && word 2 of newinputput newinputexit idleend ifget second word of newinputif it is "PRIVMSG" thenput ctoc(linefeed,return,newinput) after card field "screen" of card "Chat"exit idleelse if it is "MODE" thenput ctoc(linefeed,return,newinput) after card field "screen" of card "Chat"exit idleend if-- get rect of field "screen"-- get (item 4 of it) - (item 2 of it)-- put (it div (the textHeight of field "screen"))-1 into linesAvailget card field "screen" & newInput-- put the number of lines in it into linesThere-- if linesThere > linesAvail then-- delete line 1 to (linesThere-linesAvail) of it-- end ifput ctoc(linefeed,return,it) into card field "screen"end ifend idle</script>
</card>
card_2824.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<script>on mouseUpset userlevel to 5end mouseUp</script>
</part>
<part>
<id>12</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <true /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>23</left>
<top>26</top>
<right>496</right>
<bottom>115</bottom>
</rect>
<style>scrolling</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Geneva</font>
<textSize>9</textSize>
<textStyle>plain</textStyle>
<textHeight>12</textHeight>
<name>screen</name>
<script></script>
</part>
<part>
<id>9</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>100</left>
<top>259</top>
<right>169</right>
<bottom>274</bottom>
</rect>
<style>rectangle</style>
<showName> <true /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <true /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Geneva</font>
<textSize>10</textSize>
<textStyle>plain</textStyle>
<name>PassiveOpen</name>
<script>on mouseUpexit mouseupglobal connectionIDput TCPPassiveOpen(item 1 of field "address",field "port", ¬field "local port") into connectionIDif connectionID contains "fail" thenput "The Result:" && connectionIDput empty into connectionIDend ifend mouseUp</script>
</part>
<part>
<id>10</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>75</left>
<top>285</top>
<right>121</right>
<bottom>300</bottom>
</rect>
<style>rectangle</style>
<showName> <true /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <true /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Geneva</font>
<textSize>10</textSize>
<textStyle>plain</textStyle>
<name>Release</name>
<script>on mouseUpglobal connectionIDTCPRelease connectionIDif the result is not empty then put "The Result:" && the resultput empty into connectionIDend mouseUp</script>
</part>
<part>
<id>13</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>121</left>
<top>254</top>
<right>174</right>
<bottom>278</bottom>
</rect>
<style>roundrect</style>
<showName> <true /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <true /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Chicago</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name>Login</name>
<script>on mouseUpglobal username,macname,fullname,nicknameput card field "nickname" of card "conf" into nicknameput card field "macname" of card "conf" into macnameput card field "fullname" of card "conf" into fullnameput card field "username" of card "conf" into usernamesendhost "user" && username && macname && "xx" && ":" & fullnamesendhost "nick" && nicknamego card "who"put empty into card field "Screen"end mouseUp</script>
<script>on mouseUpglobal connectionIDput empty into card field "screen"if connectionID is empty thenput item 1 of field "address"put "," & field "port" after messageput "," & field "local port" after message-- exit mouseupput TCPActiveOpen(item 1 of field "address", field "port", ¬field "local port") into connectionIDif connectionID contains "fail" thenput "The Result:" && connectionIDput empty into connectionIDend ifsend mouseup to card button "Login"elseput "Connection active id = " & connectionID & " Close first."send mouseup to card button "Close"end ifend mouseUp</script>
</part>
<part>
<id>22</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>25</left>
<top>284</top>
<right>124</right>
<bottom>304</bottom>
</rect>
<style>roundrect</style>
<showName> <true /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <true /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Chicago</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name>Close</name>
<script>on mouseUpglobal connectionIDTCPClose connectionIDif the result is not empty then put "The Result:" && the result-- lisatty SKa:TCPRelease connectionIDif the result is not empty then put "The Result:" && the resultput empty into connectionIDend mouseUp</script>